<template>
    <h2 class="mb-2">物易近</h2>
    <!-- <img src="../assets/img/logo.jpg"> -->
    <!-- <router-link to="./information"><h4 class="A">个人信息</h4></router-link> -->
    <el-menu
    active-text-color="#ffd04b"
    background-color="rgb(11,2,71)"
      class="el-menu-vertical-demo"
      default-active="2"
      text-color="#fff"
      @open="handleOpen"
      @close="handleClose"
    >
    <el-menu-item index="4" @click="goto('information')">
      <span>我的个人信息</span>
    </el-menu-item> 

      <el-sub-menu index="1">
        <template #title>
          <span>待领取订单</span>
        </template>
          <el-menu-item index="1-1" @click="goto('buy')">帮我买</el-menu-item>
          <el-menu-item index="1-2" @click="goto('take')">帮我取</el-menu-item>
          <el-menu-item index="1-3" @click="goto('give')">帮我送</el-menu-item>
      </el-sub-menu>

      <el-sub-menu index="2">
        <template #title>
          <span>已抢到的订单</span>
        </template>
          <el-menu-item index="2-1" @click="goto('ing')">正在进行</el-menu-item>
          <el-menu-item index="2-2" @click="goto('ok')">已完成无评价</el-menu-item>
          <el-menu-item index="2-3" @click="goto('okhas')">已完成有评价</el-menu-item>
      </el-sub-menu>

      <el-menu-item index="3"  @click="goto('wmessage')">
        <span>留言</span>
      </el-menu-item>

    </el-menu>
</template>

<script setup>
   import router from "../router"
import {
  Document,
  Menu as IconMenu,
  Location,
  Setting,
} from '@element-plus/icons-vue'
const handleOpen = (key, keyPath) => {
  console.log(key, keyPath)
}
const handleClose = (key, keyPath) => {
  console.log(key, keyPath)
}

const goto=(name)=>{
    router.push({name:name});
}
</script>

<style lang="scss" scoped>
img{
  margin-top: 30px;
  margin-left: 50px;
  width: 100px;
  height: 100px;
  border-radius: 100px 100px;
}
h4{
  margin-top: 15px;
  text-align: center;
  color: #fff;
}
h2{
    text-align: center;
}
.el-menu-vertical-demo{
  margin-top: 20px;
}
</style>